#ifndef _NETWORKINTERFACE_H_
#define _NETWORKINTERFACE_H_

#include "qcustomplot.h"
#include <armadillo>

// class StateMonitorWidget;

class NetworkInterface : public QObject
{
    Q_OBJECT

private:

    // 电极图
    QCustomPlot *networkPlot;
    // 脑网络连线指针容器
    std::vector<QCPItemLine*> lines_vector;
    // 偏移量
    int x_dev;
    int y_dev;
    // 稀疏系数,用于显示网络连线的密集程度
    double sparseDegree;

    // 脑网络数据
    arma::rowvec networkData;


    
public:
    explicit NetworkInterface(QCustomPlot* plotWidget);
    ~NetworkInterface();

    int get_LineNum();
    
    int add_line(const uint16_t start_point[2], const uint16_t end_point[2]);
    void clear();
    void networkCreate();
    void networkReplot();
    void set_networkData(arma::rowvec data){networkData = data;};

    struct Pair {
        int i;
        int j;
    };

private slots:

private:
    std::pair<int, int> calculateIndices(int k);
    std::vector<Pair> findHighCorrelations(const arma::rowvec& network, double threshold);
    std::vector<std::pair<int, int>> get_top_pairs(const arma::rowvec& network, double percent);



};

#endif
